
<!DOCTYPE html>
<html lang="zh" >
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <title>新增定时任务</title>
    <link href="../../nuoyi/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../../nuoyi/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- bootstrap-table 表格插件样式 -->
    <link href="../../nuoyi/ajax/libs/bootstrap-table/bootstrap-table.min.css?v=20201129" rel="stylesheet"/>
    <link href="../../nuoyi/css/animate.css" rel="stylesheet"/>
    <link href="../../nuoyi/css/style.css?v=20200903" rel="stylesheet"/>
    <link href="../../nuoyi/ruoyi/css/ry-ui.css?v=4.6.0" rel="stylesheet"/>

</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-job-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">任务名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name"  required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">任务分组：</label>
            <div class="col-sm-8">
                <select name="goupname" class="form-control m-b">
                    <option value="DEFAULT">默认</option>
                    <option value="SYSTEM">系统</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">调用目标字符串：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="clazz"  required>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Bean调用示例：ryTask.ryParams('ry')</span>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Class类调用示例：com.ruoyi.quartz.task.RyTask.ryParams('ry')</span>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 参数说明：支持字符串，布尔类型，长整型，浮点型，整型</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required" >cron表达式：</label>
            <div class="col-sm-8">
                <input class="form-control"  value="0/10 * * * * ?" type="text" name="cron" id="cronExpression" required>
            </div>
        </div>
 <!--       <div class="form-group">
            <label class="col-sm-3 control-label">执行策略：</label>
            <div class="col-sm-8">
                <label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" checked="checked"/> 立即执行 </label>
                <label class="radio-box"> <input type="radio" name="misfirePolicy" value="2" /> 执行一次 </label>
                <label class="radio-box"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label>
            </div>
        </div>-->
     <!--   <div class="form-group">
            <label class="col-sm-3 control-label">并发执行：</label>
            <div class="col-sm-8">
                <label class="radio-box"> <input type="radio" name="concurrent" value="0"/> 允许 </label>
                <label class="radio-box"> <input type="radio" name="concurrent" value="1" checked="checked"/> 禁止 </label>
            </div>
        </div>-->
        <!-- <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <div class="radio-box">
                    <input type="radio" id="8" name="status" value="0" checked="checked">
                    <label for="8">正常</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="9" name="status" value="1">
                    <label for="9">暂停</label>
                </div>
            </div>
        </div> -->
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="note" class="form-control"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-8">
                <a class="btn btn-success" id="tijiao">
                    <i class="fa fa-plus"></i> 提交
                </a>
                <a class="btn btn-success" id="quxiao" >
                    <i class="fa fa-plus"></i> 取消
                </a>
            </div>
        </div>
    </form>
</div>
<script> var ctx = "\/"; var lockscreen = null; if(lockscreen){window.top.location=ctx+"lockscreen";} </script>
<a id="scroll-up" href="#" class="btn btn-sm display"><i class="fa fa-angle-double-up"></i></a>
<script src="../../nuoyi/js/jquery.min.js"></script>
<script src="../../nuoyi/js/bootstrap.min.js"></script>
<!-- bootstrap-table 表格插件 -->
<script src="../../nuoyi/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20201129"></script>
<script src="../../nuoyi/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20201129"></script>
<script src="../../nuoyi/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js?v=20201129"></script>
<!-- jquery-validate 表单验证插件 -->
<script src="../../nuoyi/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="../../nuoyi/ajax/libs/validate/messages_zh.min.js"></script>
<script src="../../nuoyi/ajax/libs/validate/jquery.validate.extend.js"></script>
<!-- jquery-validate 表单树插件 -->
<script src="../../nuoyi/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
<!-- 遮罩层 -->
<script src="../../nuoyi/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="../../nuoyi/ajax/libs/iCheck/icheck.min.js"></script>
<script src="../../nuoyi/ajax/libs/layer/layer.min.js"></script>
<script src="../../nuoyi/ajax/libs/layui/layui.js"></script>
<script src="../../nuoyi/ruoyi/js/common.js?v=4.6.0"></script>
<script src="../../nuoyi/ruoyi/js/ry-ui.js?v=4.6.0"></script>

<script type="text/javascript">
    var prefix = ctx + "monitor/job";

    $("#tijiao").click(function () {
        var data= $("#form-job-add").serialize();
        msg = decodeURIComponent(data,true);
        msg=DataDeal.formToJson(msg);
        alert(msg)
        var data2=url('post','/addjob2',msg);
        alert(JSON.stringify(data2))
    })

    $("#quxiao").click(function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })

    function url(requestObject,url,data) {
        var data1='';
        $.ajax({
            type: requestObject,
            url: url,
            data:data,
            async:false,
            contentType: "application/json;charset=UTF-8",
            dataType: 'json',
            success: function(data) {
                data1=data;
            }
        })
        return data1
    }

    var DataDeal = {
        //将从form中通过$('#refer').serialize()获取的值转成json
        formToJson: function (data) {
            data=data.replace(/&/g,"\",\"");
            data=data.replace(/=/g,"\":\"");
            data="{\""+data+"\"}";
            return data;
        }
    };


    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-job-add').serialize());
        }
    }
</script>
</body>
</html>